import datetime
from pydantic import BaseModel, Field

# Schema for requesting image generation
class ImageGenerateRequest(BaseModel):
    prompt: str = Field(..., min_length=1, max_length=1000) # Add sensible limits

# Base schema for image history entry
class ImageHistoryBase(BaseModel):
    prompt: str
    image_url: str

# Schema for creating an image history entry (internal use)
class ImageHistoryCreate(ImageHistoryBase):
    user_id: int

# Schema for reading image history data
class ImageHistory(ImageHistoryBase):
    id: int
    user_id: int
    created_at: datetime.datetime
    is_deleted: bool

    class Config:
        from_attributes = True

# Schema for response after generation request
class ImageGenerateResponse(BaseModel):
    image_url: str
    history_id: int # ID of the created history record
